package xcmg.device.service.safetyStock;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xcmg.device.dao.entity.safetyStock.ComSafetyStockInfo;
import xcmg.device.dao.mapper.safetyStock.ComSafetyStockInfoMapper;

import java.util.List;

/**
 * @author wangyong
 */
@Service
public class ComSafetyStockInfoService {

  @Autowired
  private ComSafetyStockInfoMapper comSafetyStockInfoMapper;

  public List<ComSafetyStockInfo> listActiveComs() {
    return comSafetyStockInfoMapper.listActiveComs();
  }

  public Integer save(ComSafetyStockInfo comSafetyStockInfo) {
    return comSafetyStockInfoMapper.insert(comSafetyStockInfo);
  }

  public Integer update(ComSafetyStockInfo comSafetyStockInfo) {
    return comSafetyStockInfoMapper.update(comSafetyStockInfo);
  }

  public ComSafetyStockInfo item(String orgId) {
    return comSafetyStockInfoMapper.getByOrgId(orgId);
  }
}